package io.jt808.proto.cmd;

import io.norland.buffer.AutoBuffer;
import io.norland.annotations.Proto;
import io.norland.proto.IProto;
import lombok.Data;

/**
 * 车辆控制
 */
@Proto("8500")
@Data
public class JT8500 implements IProto {
    /**
     * 控制标志
     * bit0：车门解锁；1：车门加锁
     */
    private byte flag;

    public final byte[] writeToBytes() {
        return new byte[]{flag};
    }

    public final void readFromBuf(AutoBuffer buffer) {
        flag = buffer.readByte();
    }
}